﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;

namespace BUS
{
    public class ChiTietLapTopBUS
    {
        public static ChiTietLapTopDTO LayChiTietLapTopTheoID(int id)
        {
            return ChiTietLapTopDAO.LayChiTietLapTopTheoID(id);
        }

        public static ChiTietLapTopDTO LayChiTiepLapTopTheoMaSanPham(int masanpham)
        {
            return ChiTietLapTopDAO.LayChiTietLapTopTheoMaSanPham(masanpham);
        }

        public static List<SanPhamDTO> TimKiemLapTopNangCao(string hangsanxuat, string thongtincpu,
           string tocdocputu, string tocdocpuden, string kichthuocmanhinh, string dungluongvgatu,
          string dungluongvgaden, string dungluongramtu, string dungluongramden, string dungluonghddtu,
          string dungluonghddden, string dungluongpin, string thongtinhedieuhanh, string trongluongmaytu,
          string trongluongmayden)
        {
            List<ChiTietLapTopDTO> temp = ChiTietLapTopDAO.TimKiemLapTopNangCao(hangsanxuat, thongtincpu,
                tocdocputu, tocdocpuden, kichthuocmanhinh, dungluongvgatu, dungluongvgaden, dungluongramtu,
                dungluongramden, dungluonghddtu, dungluonghddden, dungluongpin, thongtinhedieuhanh, trongluongmaytu, trongluongmayden);
            List<SanPhamDTO> result = new List<SanPhamDTO>();
            for (int i = 0; i < temp.Count; i++)
            {
                result.Add(SanPhamBUS.LaySanPhamTheoID(temp[i].MaSanPham));
            }
            return result;
        }
    }
}
